package com.wbl.tijiancms.controller;

import com.wbl.tijiancms.pojo.Orders;
import com.wbl.tijiancms.pojo.Overallresult;
import com.wbl.tijiancms.response.ApiRestResponse;
import com.wbl.tijiancms.service.OverallresultService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RequestMapping("/result")
@RestController
public class OverallResultController {

    @Autowired
    OverallresultService overallresultService;

    @ResponseBody
    @PostMapping("/getByorderid")
    public ApiRestResponse getOrderlistforuser(@RequestBody Overallresult overallresult){
        return overallresultService.getResultlist(overallresult);
    }

    @ResponseBody
    @PostMapping("/confirmResult")
    public ApiRestResponse confirmResult(@RequestBody List<Overallresult> overallresults) throws Exception {
        return overallresultService.ConfirmOrder(overallresults);
    }
}
